
//vue3.0 搭配 vue-router4.0
import { createRouter,createWebHistory, createWebHashHistory } from 'vue-router';
export const constantRoutes = [
    {
        path: '/',
        name: 'Index',
        component: () => import('../components/layout/index.vue'),
        redirect: '/dashboard',
        children:[
            {
                path:'dashboard',
                component: () => import('../views/index.vue'),                
            },
            {
                path:'userList',
                component: () => import('../views/system/user/index.vue'),                
            }
        ]
    },
    {
        path: '/login',
        meta: { title: '登录', noCache: true },
        name:'Login',
        component: () => import('../views/user/login.vue'),
        hidden: true
    },
]
export default createRouter({
    //history: createWebHashHistory(), //hash 模式
    history: createWebHistory(), //history 模式
    routes: constantRoutes
})
